import request from '@/utils/request'
// 查询机构列表
export function listOrg(query) {
    return request({
        url: '/system/org/list',
        method: 'get',
        params: query
    })
}

export function currentList(query) {
    return request({
        url: '/system/org/currentList',
        method: 'get',
        params: query
    })
}
// 查询机构列表（排除节点）
export function listOrgExcludeChild(orgId) {
    return request({
        url: '/system/org/list/exclude/' + orgId,
        method: 'get'
    })
}

// 查询机构详细
export function getOrg(orgId) {
    return request({
        url: '/system/org/' + orgId,
        method: 'get'
    })
}

// 新增机构
export function addOrg(data) {
    return request({
        url: '/system/org/add',
        method: 'post',
        data: data
    })
}

// 编辑机构
export function updateOrg(data) {
    return request({
        url: '/system/org/edit',
        method: 'put',
        data:data
    })
}

// 删除机构
export function delOrg(orgId) {
    return request({
        url: '/system/org/remove/' + orgId,
        method: 'get'
    })
}

// 查询机构下拉树结构
export function getAllOrgList(query) {
    return request({
        url: '/system/user/orgTree',
        method: 'get',
        params: query
    })
}
export function getLazyTreeNode(query) {
    return request({
        url: `/system/org/list/excludetree/${query}`,
        method: 'get',
        params: query
    })
}

export function getDictList(query) {
    return request({
        url: `/system/dict/data/type/${query}`,
        method: 'get',
    })
}

export function getDictNatureList(query) {
    return request({
        url: `/system/org/selectTypePal/${query}`,
        method: 'get',
    })
}

export function getGroupCategory(query) {
  return request({
    url: `/system/org/Institutionalplatform/${query}`,
    method: "get",
  });
}

export function getPlatformCategory(query) {
  return request({
    url: `/system/dict/data/dictType`,
    method: "get",
    params: query,
  });
}

// 查询/修改设置机构数据
export function getOrgData(data) {
    return request({
        url: '/system/org/updateType',
        method: 'post',
        data: data
    })
}


//
export function getOrgTree(data) {
    return request({
        url: '/system/org/selectType',
        method: 'get',
        params: data
    })
}

export function getOrgTreeList(query) {
    return request({
        url: '/system/org/tree',
        method: 'get',
        params: query
    })
}
export function getOrgBranch(query) {
    return request({
        url: '/system/org/orgBranch',
        method: 'get',
        params: query
    })
}
// 提交设置集团类型
export function setOrgType(data) {
    return request({
        url: '/system/org/updateType',
        method: 'post',
        data: data
    })
}

// 获取父节点
export function getSuperiorOrganization(orgId) {
  return request({
    url: '/system/org/superiorOrganization/' + orgId,
    method: 'get'
  })
}

// 获取资费套餐
export function getFee(id) {
  return request({
    url: "/system/fee/?id=" + id,
    method: "get",
  });
}
